package com.wnnight.wys.entity.role;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wnnight.wys.groupInterface.AddGroup;
import com.wnnight.wys.groupInterface.AlterGroup;
import lombok.*;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * ClassName: Role
 * Description: 角色表
 * author: dz
 * date: 2022-08-27-19:53
 */
@Getter
@Setter
@ToString
@AllArgsConstructor // 添加一个构造函数，该构造函数含有所有已声明字段属性参数
@NoArgsConstructor // 添加一个无参数的构造器
@TableName("wys_role") //告诉mybatis-plus,数据库表名叫什么
public class Role {

    @TableId(type = IdType.AUTO)
    @NotNull(message = "角色id不能为空",groups = AlterGroup.class)
    private Integer id;
    @NotNull(message = "角色名称不能为空",groups = {AlterGroup.class, AddGroup.class})
    private String name;  //角色名称
    @NotNull(message = "角色描述不能为空",groups = {AlterGroup.class, AddGroup.class})
    private String description;
    private String status; // y:正常  n:已删除
    @TableField(exist = false)
    private List<MenuPerm> menuPerms;

}
